﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CMTVision.Widgets
{
    [ViewStateModeById]
    public partial class ShowWidgets : CMTVision.Widgets.Impls.TemplatePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //ForceRefresh();
        }
         
        protected void EditButton_Click(object sender, EventArgs e)
        {
            IsInEditMode = !IsInEditMode ;
            ForceRefresh();
            EditButton.Text = IsInEditMode ? "StopEdit" : "Edit";  
        }

        protected override Control GetTemplateContainer()
        {
            return TemplateContainer;
        }

        protected override void OnInit(EventArgs e)
        {
            PageID = 1;
            base.OnInit(e);
            InitializeWidgetsTemplate();
        }
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
        }

        public override Control FindControl(string id)
        {
            return (Template as Control).FindControl(id)?? base.FindControl(id);
        }

        protected override void LoadViewState(object savedState)
        {
            base.LoadViewState(savedState);
        }
         
    }
}